<template>
  <div>
    <section>
      <div class="line" @click="$commonJs.goPage('personResetLoginPsw')">
        <p>登录密码</p>
        <i class="iconfont icongengduo"></i>
      </div>
      <div class="line" @click="toPayPwd">
        <p>支付密码</p>
        <i class="iconfont icongengduo"></i>
      </div>
    </section>
  </div>
</template>

<script>
export default {
  name: "login",
  data() {
    return {
      is_pay: ""
    };
  },
  methods: {
    toPayPwd() {
      if (this.is_pay === "YES") {
        this.$router.push("/index/person/reset-pay-psw");
      } else {
        this.$router.push("/index/person/set-pay-psw");
      }
    },
    judgePwd() {
      this.$ajax
        .post(this.$api.judgePayPwd)
        .then(res => {
          this.is_pay = res.data.is_pay;
        })
        .catch(err => {
          this.$toast.failed(err);
        });
    }
  },
  created() {
    this.judgePwd();
  }
};
</script>

<style scoped lang="stylus">
section{
  padding-top 18px;
}
.line{
  width 100%;
  padding 39px 22px;
  background-color #ffffff;
  box-sizing border-box;
  display flex;
  justify-content space-between;
  font-size 26px;
  color #333333;
}
.line:nth-of-type(1){
  border-bottom 2px solid #E6E6E6;
}
</style>
